<form  method="post" id="formID"  name="test" action="">
<? if (count($this->questionnoreply)>0):?>
<? for ($i = 0; $i < count($this->listquestion); $i++) :?>
<? $QuestionLabel="";?>
	<? for ($y = 0; $y < count($this->questionnoreply); $y++) :?>
	<? if($this->questionnoreply[$y]==$i): $QuestionLabel = "<==== Need to answer this question";?>
	<? endif;?>
	<? endfor;?>
<? $Question = $this->listquestion[$i]->getText().$QuestionLabel;?>
<?	$checkbox ="";?>
<b><?php echo $Question; ?></b><br/>				
<? if($this->listquestion[$i]->getType() == 1): $checkbox = "checkbox";?>
<? else: $checkbox = "radio"; ?>		
<? endif; ?>
<? for ($j = 0; $j < count($this->listquestion[$i]->getAnswers()); $j++):?>
<? $checked = "";?>
<? $Massreply= $this->listquestion[$i]->getAnswers();?>
<? $textOptionReply = $Massreply[$j]->getText();?>
<? $valueOptionReply = $j;?>
<? if($checkbox == "radio"): $num = 0;?>
<? else: $num = $j;?>	
<? endif; ?>
<? if($this->post[question][$i][$j] != NULL): $checked = "checked";?>
<? endif; ?>
<? if($this->post[question][$i][0] != NULL):?>
<? if($this->post[question][$i][0] == $j):	$checked = "checked";?>
<? endif; ?>
<? endif; ?>
<INPUT  id="otvet<?php echo $i;?>" class="validate[minCheckbox[1]] checkbox"  type="<?php echo $checkbox;?>" name="question[<?php echo $i;?>][<?php echo $num;?>]" value="<?php echo $valueOptionReply;?>" <?php echo $checked;?> > <?php echo $textOptionReply;?><br/>					
<?endfor;?>
<?endfor;?>

<? else:?>
<? for ($i = 0; $i < count($this->listquestion); $i++):?> 
<? $Question = $this->listquestion[$i]->getText(); $checkbox =""; ?>
<b><?php echo $Question; ?></b><br/>
<? if($this->listquestion[$i]->getType() == 1): $checkbox = "checkbox";?>
<? else: $checkbox = "radio"; ?>		
<? endif; ?>
<? for  ($j = 0; $j < count($this->listquestion[$i]->getAnswers()); $j++): ?>
<? $Massreply= $this->listquestion[$i]->getAnswers(); ?>
<? $textOptionReply = $Massreply[$j]->getText(); ?>
<? $valueOptionReply = $j;?>
<? if($checkbox == "radio"): $num = 0;?>
<? else: $num = $j;?>	
<? endif; ?>				
<INPUT  id="otvet<?php echo $i;?>" class="validate[minCheckbox[1]] checkbox"  type="<?php echo $checkbox;?>" name="question[<?php echo $i;?>][<?php echo $num;?>]" value="<?php echo $valueOptionReply;?>" <?php echo $checked;?> > <?php echo $textOptionReply;?><br/>					
<? endfor;?>		
<? endfor;?>
<? endif; ?>	
<input class="submit" type="submit" value="Send"/> <input type=reset value=Reset> </form>
You were authorized in the closed section<br><a href='index.php?views=logout'>Logout</a>.		


